Skip to content

fix(server): say up front that attach pauses the target (#654) - #660

Merged
debugmcpdev merged 1 commit into
mainfrom
fix/654-attach-pause-schema
Sep 2, 2026
Merged

fix(server): say up front that attach pauses the target (#654)#660
debugmcpdev merged 1 commit into
mainfrom
fix/654-attach-pause-schema

Conversation

@debugmcpdev

Copy link
Copy Markdown
Collaborator

Fixes #654

Problem

attach_to_process (and the inline attach in create_debug_session) defaults stopOnEntry to true: thread verification, then a DAP pause. The docs said so, but the in-band schema an agent actually reads said only "Stop on entry after attaching", and create_debug_session did not advertise stopOnEntry at all even though its handler forwards it. start_debugging defaults the same flag to false, so an agent carrying that expectation over to a live server got state: "running" back and a frozen server nine seconds later, with nothing in the response saying a pause was coming.

Changes

  • Schema (src/server/tool-schemas.ts): attach_to_process.stopOnEntry and a new create_debug_session.stopOnEntry state the default and the live-service case; start_debugging.dapLaunchArgs.stopOnEntry documents its opposite default; the create_debug_session description says attaching pauses. 24 tool-list snapshots regenerated — exactly those four hunks.
  • Self-announcing pending pause (attach-controller.ts, session-tools.ts, error-messages.ts): when the post-attach pause has not landed by the time the tool answers, both message fields end with ; post-attach pause pending — the target stops when it next executes code (pass stopOnEntry: false to attach without pausing) next to the existing pending: true. Observed pauses and stopOnEntry: false keep the plain message. state stays "running" because that is true at that moment.
  • set_breakpoint attach rejection (src/server.ts): the remedy is feature-specific — an expectedContent caller already passed line, so "use line addressing instead" read as a contradiction; it now says to drop expectedContent and keep line. statement keeps "use line addressing instead".
  • Docs/skill: tool-reference (new create_debug_session param, a running + pending example, launch/attach contrast), agent guide, skills/debugging/SKILL.md attach bullet, javascript README, and the cpp/kubernetes notes that claimed the default was C/C++-specific.
  • changelog.d/654.fixed.md.

Deliberately unchanged: the attach default itself (item 3 of the issue). Seven e2e attach tests across python/js/java/dotnet/ruby pin "omitted stopOnEntry ⇒ paused"; flipping it is a cross-language behavior change that deserves its own issue.

Verification

🤖 Generated with Claude Code

https://claude.ai/code/session_01DP1W22KJbkHZi4ueAtMFPF

attach_to_process defaults stopOnEntry to true (thread verification, then
a pause request) and the docs said so, but the in-band schema an agent
actually reads said only "Stop on entry after attaching", and
create_debug_session — which forwards args.stopOnEntry into the same
inline attach — did not advertise the property at all. start_debugging
defaults the same flag to false, so an agent carrying that expectation
over froze the live server it had attached to, nine seconds after a
response that said state "running".

- tool-schemas: attach_to_process.stopOnEntry and a new
  create_debug_session.stopOnEntry state the default and the live-service
  case; start_debugging.dapLaunchArgs.stopOnEntry documents its opposite
  default; the create_debug_session description says attaching pauses.
- attach-controller / session-tools: when the post-attach pause has not
  landed by the time the tool answers, both message fields name it
  ("…; post-attach pause pending — the target stops when it next executes
  code (pass stopOnEntry: false to attach without pausing)") next to the
  existing pending:true. Observed pauses and stopOnEntry:false keep the
  plain message. The attach default itself is unchanged.
- server.ts: the attach rejection for content addressing is
  feature-specific — expectedContent callers already passed line, so
  "use line addressing instead" read as a contradiction; it now says to
  drop expectedContent and keep line.
- docs/skill: tool-reference (create_debug_session param, running+pending
  example), agent guide, SKILL.md attach bullet, javascript README, and
  the cpp/kubernetes notes that claimed the default was C/C++-specific.
- tests: 24 tool-list snapshots regenerated (four description hunks),
  pending-message assertions on the attach controller and the inline
  attach envelope, remedy wording pinned.

Verified live against `node --inspect` targets through a server built
from this branch: omitted stopOnEntry → paused (or pending when late),
stopOnEntry:false → running with the target still answering, and the
new set_breakpoint wording on an attach session.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DP1W22KJbkHZi4ueAtMFPF
@debugmcpdev
debugmcpdev merged commit a8066ca into main Sep 2, 2026
8 checks passed
@debugmcpdev
debugmcpdev deleted the fix/654-attach-pause-schema branch September 2, 2026 13:31
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/session/attach/attach-controller.ts 80.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

attach: omitted stopOnEntry pauses the target, but the in-band schema does not say so — attaching to a live server froze it

1 participant